using System;
using Microsoft.WowAddonStudio.Lua.RuntimeService.ShellHost;
using Microsoft.WowAddonStudio.Lua.RuntimeService.ToolWindows;
using Microsoft.WowAddonStudio.Lua.RuntimeService.WowBench;

namespace Microsoft.WowAddonStudio.Lua.RuntimeService
{
	/// <summary>
	/// Defines interface for LuaRuntime implementations.
	/// </summary>
	public interface ILuaRuntime : IDisposable
	{
		/// <summary>
		/// Gets the IToolWindowControl implementation.
		/// </summary>
		IToolWindowControl ToolWindowControl { get; set; }

		/// <summary>
		/// Gets the IWoWBenchController implementation.
		/// </summary>
		IWoWBenchController RuntimeController { get; set; }

		/// <summary>
		/// Gets the current ShellHost for runtime.
		/// </summary>
		IShellHost RuntimeShellHost { get; set; }

		/// <summary>
		/// Gets the path of WoWBench application.
		/// </summary>
		string WowBenchPath { get; set; }

		/// <summary>
		/// Gets IShellHostFactory implementation.
		/// </summary>
		IShellHostFactory HostFactory { get; set; }

		/// <summary>
		/// Gets the name of the Runtime.
		/// </summary>
		string Name { get; }

		/// <summary>
		/// Gets a value indicating whether the runtime has been disposed of.
		/// </summary>
		bool IsDisposed { get; }

		/// <summary>
		/// Load the specified Lua Runtime by <paramref name="runtimeType"/> parameter.
		/// </summary>
		/// <param name="runtimeType">The <see cref="LuaRuntimeType"/> parameter.</param>
		/// <returns>True if process started successfully, otherwise false.</returns>
		bool Load(LuaRuntimeType runtimeType);

		/// <summary>
		/// Adds a lua file to the runtime.
		/// </summary>
		/// <param name="luaFilePath">The path to the lua file.</param>
		void AddLuaFile(string luaFilePath);

		/// <summary>
		/// Removes a lua file from the runtime.
		/// </summary>
		/// <param name="luaFilePath">The path to the lua file.</param>
		void RemoveLuaFile(string luaFilePath);

		/// <summary>
		/// Evaluates a Lua expression.
		/// </summary>
		/// <param name="expression">The expression text.</param>
		/// <returns></returns>
		object EvaluateExpression(string expression);
	}
}